//
//  ByCellShopIndexFixedPart.m
//  mijifen_ios
//
//  Created by 朱凯 on 2017/11/1.
//  Copyright © 2017年 itboye. All rights reserved.
//

#import "ByCellShopIndexFixedPart.h"

@implementation ByCellShopIndexFixedPart
{
    UIImageView *_imageView1;
    UIImageView *_imageView2;
    UIImageView *_imageView3;
    UIImageView *_imageView4;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.selectionStyle = UITableViewCellSeparatorStyleNone;
        self.backgroundColor = [UIColor clearColor];
        [self setupUI];
    }
    return self;
}
- (void)setupUI {
    
    _imageView1 = [UIImageView new];
    _imageView1.image = [UIImage imageNamed:@"头视图背景"];
    [self.contentView addSubview:_imageView1];
    UILabel *label1 = [[UILabel alloc] init];
    label1.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.4];
    label1.text = @"自营";
    label1.font = FONT(14);
    label1.textAlignment = NSTextAlignmentCenter;
    label1.textColor = [UIColor blackColor];
    [_imageView1 addSubview:label1];
    
    _imageView2 = [UIImageView new];
    _imageView2.image = [UIImage imageNamed:@"头视图背景"];
    [self.contentView addSubview:_imageView2];
    UILabel *label2 = [[UILabel alloc] init];
    label2.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.4];
    label2.text = @"9.9包场";
    label2.font = FONT(14);
    label2.textAlignment = NSTextAlignmentCenter;
    label2.textColor = [UIColor blackColor];
    [_imageView2 addSubview:label2];
    
    _imageView3 = [UIImageView new];
    _imageView3.image = [UIImage imageNamed:@"头视图背景"];
    [self.contentView addSubview:_imageView3];
    UILabel *label3 = [[UILabel alloc] init];
    label3.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.4];
    label3.text = @"体验专享";
    label3.font = FONT(14);
    label3.textAlignment = NSTextAlignmentCenter;
    label3.textColor = [UIColor blackColor];
    [_imageView3 addSubview:label3];
    
    _imageView4 = [UIImageView new];
    _imageView4.image = [UIImage imageNamed:@"头视图背景"];
    [self.contentView addSubview:_imageView4];
    UILabel *label4 = [[UILabel alloc] init];
    label4.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.4];
    label4.text = @"汽车保养";
    label4.font = FONT(14);
    label4.textAlignment = NSTextAlignmentCenter;
    label4.textColor = [UIColor blackColor];
    [_imageView4 addSubview:label4];
    
    
    [_imageView1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(@10);
        make.width.equalTo(self.contentView).multipliedBy(8.0 / 15);
        make.height.equalTo(_imageView1.mas_width).multipliedBy(11.0 / 20);
    }];
    [label1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(_imageView1);
        make.width.height.equalTo(_imageView1).multipliedBy(0.5);
    }];
    
    [_imageView2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.equalTo(_imageView1);
        make.left.equalTo(_imageView1.mas_right).offset(10);
        make.right.equalTo(@-10);
    }];
    [label2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(_imageView2);
        make.width.height.equalTo(_imageView2).multipliedBy(0.5);
    }];
    
    [_imageView3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.equalTo(_imageView2);
        make.left.equalTo(_imageView1);
        make.top.equalTo(_imageView1.mas_bottom).offset(10);
    }];
    [label3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(_imageView3);
        make.width.height.equalTo(_imageView3).multipliedBy(0.5);
    }];
    [_imageView4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.equalTo(_imageView1);
        make.top.equalTo(_imageView3);
        make.left.equalTo(_imageView3.mas_right).offset(10);
        make.bottom.equalTo(self.contentView);
    }];
    [label4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(_imageView4);
        make.width.height.equalTo(_imageView4).multipliedBy(0.5);
    }];
    
}

@end
